Optimal. Leaf size=266 \[ \frac{3 \left (a^2-b^2\right ) \cos (c+d x)}{b^4 d}+\frac{2 \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{b^5 d}-\frac{2 \left (a^2-b^2\right )^{3/2} \left (5 a^2+b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a^2 b^5 d}+\frac{\left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 d (a+b \sin (c+d x))}+\frac{2 a x \left (2 a^2-3 b^2\right )}{b^5}-\frac{\tanh ^{-1}(\cos (c+d x))}{a^2 d}-\frac{a \sin (c+d x) \cos (c+d x)}{b^3 d}+\frac{a x}{b^3}-\frac{\cos ^3(c+d x)}{3 b^2 d}+\frac{\cos (c+d x)}{b^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.350575, antiderivative size = 266, normalized size of antiderivative = 1., number of steps used = 16, number of rules used = 11, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.407, Rules used = {2897, 3770, 2638, 2635, 8, 2633, 2664, 12, 2660, 618, 204} \[ \frac{3 \left (a^2-b^2\right ) \cos (c+d x)}{b^4 d}+\frac{2 \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{b^5 d}-\frac{2 \left (a^2-b^2\right )^{3/2} \left (5 a^2+b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a^2 b^5 d}+\frac{\left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 d (a+b \sin (c+d x))}+\frac{2 a x \left (2 a^2-3 b^2\right )}{b^5}-\frac{\tanh ^{-1}(\cos (c+d x))}{a^2 d}-\frac{a \sin (c+d x) \cos (c+d x)}{b^3 d}+\frac{a x}{b^3}-\frac{\cos ^3(c+d x)}{3 b^2 d}+\frac{\cos (c+d x)}{b^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2897
Rule 3770
Rule 2638
Rule 2635
Rule 8
Rule 2633
Rule 2664
Rule 12
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\cos ^5(c+d x) \cot (c+d x)}{(a+b \sin (c+d x))^2} \, dx &=\int \left (-\frac{2 \left (-2 a^3+3 a b^2\right )}{b^5}+\frac{\csc (c+d x)}{a^2}+\frac{3 \left (-a^2+b^2\right ) \sin (c+d x)}{b^4}+\frac{2 a \sin ^2(c+d x)}{b^3}-\frac{\sin ^3(c+d x)}{b^2}+\frac{\left (a^2-b^2\right )^3}{a b^5 (a+b \sin (c+d x))^2}-\frac{\left (a^2-b^2\right )^2 \left (5 a^2+b^2\right )}{a^2 b^5 (a+b \sin (c+d x))}\right ) \, dx\\ &=\frac{2 a \left (2 a^2-3 b^2\right ) x}{b^5}+\frac{\int \csc (c+d x) \, dx}{a^2}+\frac{(2 a) \int \sin ^2(c+d x) \, dx}{b^3}-\frac{\int \sin ^3(c+d x) \, dx}{b^2}-\frac{\left (3 \left (a^2-b^2\right )\right ) \int \sin (c+d x) \, dx}{b^4}+\frac{\left (a^2-b^2\right )^3 \int \frac{1}{(a+b \sin (c+d x))^2} \, dx}{a b^5}-\frac{\left (\left (a^2-b^2\right )^2 \left (5 a^2+b^2\right )\right ) \int \frac{1}{a+b \sin (c+d x)} \, dx}{a^2 b^5}\\ &=\frac{2 a \left (2 a^2-3 b^2\right ) x}{b^5}-\frac{\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac{3 \left (a^2-b^2\right ) \cos (c+d x)}{b^4 d}-\frac{a \cos (c+d x) \sin (c+d x)}{b^3 d}+\frac{\left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 d (a+b \sin (c+d x))}+\frac{a \int 1 \, dx}{b^3}+\frac{\left (a^2-b^2\right )^2 \int \frac{a}{a+b \sin (c+d x)} \, dx}{a b^5}+\frac{\operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{b^2 d}-\frac{\left (2 \left (a^2-b^2\right )^2 \left (5 a^2+b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{a^2 b^5 d}\\ &=\frac{a x}{b^3}+\frac{2 a \left (2 a^2-3 b^2\right ) x}{b^5}-\frac{\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac{\cos (c+d x)}{b^2 d}+\frac{3 \left (a^2-b^2\right ) \cos (c+d x)}{b^4 d}-\frac{\cos ^3(c+d x)}{3 b^2 d}-\frac{a \cos (c+d x) \sin (c+d x)}{b^3 d}+\frac{\left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 d (a+b \sin (c+d x))}+\frac{\left (a^2-b^2\right )^2 \int \frac{1}{a+b \sin (c+d x)} \, dx}{b^5}+\frac{\left (4 \left (a^2-b^2\right )^2 \left (5 a^2+b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{a^2 b^5 d}\\ &=\frac{a x}{b^3}+\frac{2 a \left (2 a^2-3 b^2\right ) x}{b^5}-\frac{2 \left (a^2-b^2\right )^{3/2} \left (5 a^2+b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a^2 b^5 d}-\frac{\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac{\cos (c+d x)}{b^2 d}+\frac{3 \left (a^2-b^2\right ) \cos (c+d x)}{b^4 d}-\frac{\cos ^3(c+d x)}{3 b^2 d}-\frac{a \cos (c+d x) \sin (c+d x)}{b^3 d}+\frac{\left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 d (a+b \sin (c+d x))}+\frac{\left (2 \left (a^2-b^2\right )^2\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{b^5 d}\\ &=\frac{a x}{b^3}+\frac{2 a \left (2 a^2-3 b^2\right ) x}{b^5}-\frac{2 \left (a^2-b^2\right )^{3/2} \left (5 a^2+b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a^2 b^5 d}-\frac{\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac{\cos (c+d x)}{b^2 d}+\frac{3 \left (a^2-b^2\right ) \cos (c+d x)}{b^4 d}-\frac{\cos ^3(c+d x)}{3 b^2 d}-\frac{a \cos (c+d x) \sin (c+d x)}{b^3 d}+\frac{\left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 d (a+b \sin (c+d x))}-\frac{\left (4 \left (a^2-b^2\right )^2\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{b^5 d}\\ &=\frac{a x}{b^3}+\frac{2 a \left (2 a^2-3 b^2\right ) x}{b^5}+\frac{2 \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{b^5 d}-\frac{2 \left (a^2-b^2\right )^{3/2} \left (5 a^2+b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a^2 b^5 d}-\frac{\tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac{\cos (c+d x)}{b^2 d}+\frac{3 \left (a^2-b^2\right ) \cos (c+d x)}{b^4 d}-\frac{\cos ^3(c+d x)}{3 b^2 d}-\frac{a \cos (c+d x) \sin (c+d x)}{b^3 d}+\frac{\left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 d (a+b \sin (c+d x))}\\ \end{align*}
Mathematica [A] time = 1.68633, size = 207, normalized size = 0.78 \[ \frac{\frac{12 a \left (4 a^2-5 b^2\right ) (c+d x)}{b^5}+\frac{9 \left (4 a^2-3 b^2\right ) \cos (c+d x)}{b^4}-\frac{24 \left (4 a^2+b^2\right ) \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a^2 b^5}+\frac{12 \left (a^2-b^2\right )^2 \cos (c+d x)}{a b^4 (a+b \sin (c+d x))}+\frac{12 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{a^2}-\frac{12 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{a^2}-\frac{6 a \sin (2 (c+d x))}{b^3}-\frac{\cos (3 (c+d x))}{b^2}}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.17, size = 778, normalized size = 2.9 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 4.95416, size = 1598, normalized size = 6.01 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22426, size = 477, normalized size = 1.79 \begin{align*} \frac{\frac{3 \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right )}{a^{2}} + \frac{3 \,{\left (4 \, a^{3} - 5 \, a b^{2}\right )}{\left (d x + c\right )}}{b^{5}} - \frac{6 \,{\left (4 \, a^{6} - 7 \, a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}\right )}{\left (\pi \left \lfloor \frac{d x + c}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + b}{\sqrt{a^{2} - b^{2}}}\right )\right )}}{\sqrt{a^{2} - b^{2}} a^{2} b^{5}} + \frac{2 \,{\left (3 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 9 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 9 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} + 18 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 3 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 9 \, a^{2} - 7 \, b^{2}\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3} b^{4}} + \frac{6 \,{\left (a^{4} b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, a^{2} b^{3} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + b^{5} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )}}{{\left (a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 2 \, b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a\right )} a^{2} b^{4}}}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]